/**
 * @file Robot2
 * The second robot in relay.
 *
 * @author TJArk
 */

option(Supporter)
{ 
	float p = -0.9f;
	common_transition
	{

	}

	initial_state(stand)
	{
		transition
		{
		    for(int i = 0; i < (int)theTeamData.teammates.size(); i++)
		    {
			if(theTeamData.teammates[i].number == 1)
			{
				if(theTeamData.teammates[i].firstRobotArrived==true)
				{
					goto walkStraight;
				}
			}
                    }
		}
		action
		{
			Stand();
		}
	}

	state(walkStraight)
	{
	   transition
	   {
		  if(theLibCodeRelease.odometryXSum >= 3500.f)
			 goto finish;
	    }
		action
		{
			WalkAtRelativeSpeed(Pose2f(p * theLibCodeRelease.odometryRSum, 0.8f, 0.f));
		}
	}

	state(finish)
	{
		transition
		{

		}
		action
		{
			Stand();
		}
	}
}
